package com.ez.supervise.dao.impl;

import java.util.List;

import com.ez.supervise.dao.UserRoleDao;
import com.ez.supervise.dao.base.BaseDaoImpl;
import com.ez.supervise.model.sys.UserRole;

public class UserRoleDaoImpl extends BaseDaoImpl implements UserRoleDao {

    public void insert(Object userRole) {
	sqlMapClientTemplate.insert("sys.insertUserRole", userRole);
    }

    public Object get(Long id) {
	return (UserRole) sqlMapClientTemplate.queryForObject("sys.getUserRoleById", id);
    }

    public void update(Object userRole) {
	sqlMapClientTemplate.update("sys.updateUserRole", userRole);
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.ez.supervise.dao.UserRoleDao#deleteUserRoleByUserid(java.lang.Long)
     */
    public void deleteUserRoleByUserid(Long userId) {
	sqlMapClientTemplate.delete("sys.deleteUserRoleByUserid", userId);
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.ez.supervise.dao.UserRoleDao#findUserRoleByUserId(java.lang.Long)
     */
    public List findUserRoleByUserId(Long userId) {
	return sqlMapClientTemplate.queryForList("sys.findUserRoleByUserId", userId);
    }
}
